import React from "react";

const Tabbar = () =>
{
    const Location = useLocation();
    const navigate = useNavigate();

    // 当前路径
    const [active,SetActive] = useState<string>(Location.pathname ?? '/');

    const OnChangTab = (key:string) =>
    {
        SetActive(key);
        navigate(key);
    }

    return (
        <>
            <React.UI.TabBar style={{ width: '100%' }} activeKey={active} onChange={OnChangTab}>
                <React.UI.TabBar.Item key={"/"} icon={<React.Icons.AppOutline />} title={"首页"} />
                <React.UI.TabBar.Item key={"/business"} icon={<React.Icons.UserOutline />} title={"我的"} />
            </React.UI.TabBar>
        </>
    )
}

export default Tabbar;